import type { DictionaryDto, EnumDto, PageDto, PageReqDto, PagesDto } from '@/api/types'
import request from '@/utils/request'
import type { AccountRecordDto } from './types'

// 修改年限
export function updateTemplateAgeLimit(data: {
    companyId: number
    effectiveTime: number
    id: number
    unit: number
}): Promise<string>{
    return request.put('/crm-prod/elesign/ele-sign-contract-template/update-template', data)
}

// 电子签充值
export function rechargeElesignAmount(data: {
    companyId: number
    payMode: number
    payMoney: number
    receiptId: number
    rechargeAmount: number
    voucherUrl: string
    remark: string
}): Promise<string>{
    return request.put('/crm-prod/elesign/ele-sign-recharge-record/ele-sign-amount-recharge', data)
}


// 电子签充值消费记录
export function getAccountRecord(params: PageReqDto & {
    companyId: number
    companyName: string
    operateType?: number
}): Promise<PageDto<AccountRecordDto>>{
    return request.get('/crm-prod/elesign/ele_sign_amount_record/query-account-record', {
        params
    })
}

// 导出电子签充值消费记录
export function exportAccountRecord(params: {
    companyId: number
    companyName: string
    operateType?: number
}): Promise<string>{
    return request.get('/crm-prod/elesign/ele_sign_amount_record/export-account-record', {
        params
    })
}


